{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d5107284-2afc-4cbc-bf97-f844912b8075",
   "metadata": {
    "tags": [
     "remove_cell"
    ]
   },
   "outputs": [],
   "source": [
    "import datapane as dp\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a9e92fd9-34f1-436d-bc9f-25758bd65e8e",
   "metadata": {
    "tags": []
   },
   "source": [
    "# Pages\n",
    "    \n",
    "::: datapane.Page\n",
    "    options:\n",
    "          members:\n",
    "              - __init__"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0402d6d1-5cfe-4702-8b94-6ffb22c03d0a",
   "metadata": {
    "tags": []
   },
   "source": [
    "## Simple Pages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "feb85b17-db4a-4042-ac49-cb2aff1085ac",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "import altair as alt\n",
    "import seaborn as sns\n",
    "\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\n",
    "points = (\n",
    "    alt.Chart(titanic)\n",
    "    .mark_point()\n",
    "    .encode(\n",
    "        x=\"age:Q\",\n",
    "        color=\"class:N\",\n",
    "        y=\"fare:Q\",\n",
    "    )\n",
    "    .interactive()\n",
    "    .properties(width=\"container\")\n",
    ")\n",
    "\n",
    "dp.Blocks(\n",
    "    dp.Page(title=\"Titanic Dataset\", blocks=[\"### Dataset\", titanic]),\n",
    "    dp.Page(title=\"Titanic Plot\", blocks=[\"### Plot\", points]),\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0375daea-7ae4-404f-a93c-b01cf62b05f7",
   "metadata": {
    "tags": [
     "remove_cell"
    ]
   },
   "source": [
    "## Pages with side navigation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ba5a1749-6b02-4197-bffe-08f6b1fadcdd",
   "metadata": {
    "tags": [
     "remove_cell"
    ]
   },
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import altair as alt\n",
    "\n",
    "titanic = sns.load_dataset(\"titanic\")\n",
    "\n",
    "points = (\n",
    "    alt.Chart(titanic)\n",
    "    .mark_point()\n",
    "    .encode(\n",
    "        x=\"age:Q\",\n",
    "        color=\"class:N\",\n",
    "        y=\"fare:Q\",\n",
    "    )\n",
    "    .interactive()\n",
    "    .properties(width=\"container\")\n",
    ")\n",
    "\n",
    "dp.Blocks(\n",
    "    dp.Page(title=\"Titanic Dataset\", blocks=[\"### Dataset\", titanic]),\n",
    "    dp.Page(title=\"Titanic Plot\", blocks=[\"### Plot\", points]),\n",
    ")"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
